package com.atjava.nebula.web.action;

import org.kie.api.runtime.KieSession;
import org.kie.api.runtime.manager.RuntimeEngine;
import org.kie.api.runtime.manager.RuntimeManager;
import org.kie.api.task.TaskService;
import org.springframework.beans.factory.annotation.Autowired;

public class BaseJbpmAction extends BaseAction {
	
	//@Autowired
	protected TaskService taskService;
	
	//@Autowired
	protected RuntimeManager jbpmManager;

	public void setTaskService(TaskService taskService) {
		this.taskService = taskService;
	}

	public void setJbpmManager(RuntimeManager jbpmManager) {
		this.jbpmManager = jbpmManager;
	}
	
	public RuntimeEngine getRuntimeEngine(){
		return jbpmManager.getRuntimeEngine(null);
	}
	
	public KieSession getKieSession(){
		return getRuntimeEngine().getKieSession();
	}

}
